package com.zhytech;

import org.springframework.web.client.RestTemplate;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;


/**
 * Created by zhy on 2017/3/12.
 */

@SpringBootApplication
public class Application {

    private static final Logger log = LoggerFactory.getLogger(Application.class);

    private String url  = "http://gturnquist-quoters.cfapps.io/api/random";
    public static void main(String args[]){

//        try {
//            String utf8= URLEncoder.encode("北京", "utf-8");
//            log.info(utf8);
//        } catch (UnsupportedEncodingException e) {
//            e.printStackTrace();
//        }

        SpringApplication.run(Application.class,args);
    }


//    public static void main(String args[]){
//        RestTemplate rt = new RestTemplate();
//        String url  = "http://gturnquist-quoters.cfapps.io/api/random";
//
//        Quote quote = rt.getForObject(url,Quote.class);
//        String q = quote.getValue().getQuote();
//        log.info(quote.toString());
//        log.info(q);
//    }


}


